//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using CommunityServer.Files.Components;
using CA = ComponentArt.Web.UI;

namespace CommunityServer.ControlPanel.UI
{
	/// <summary>
	/// Summary description for BaseBlogControl.
	/// </summary>
	public class BaseFilesGridControl : BaseGridControl
	{
		public BaseFilesGridControl()
		{
		}

		protected BaseFilesPage FilesPage
		{
			get {return this.PanelPage as BaseFilesPage;}
		}

		protected Folder CurrentFolder
		{
			get { return this.FilesPage.CurrentFolder;}
		}

		protected override void ConfigureGridColumnProperties()
		{
			base.ConfigureGridColumnProperties();

			foreach(CA.GridColumn gc in Grid.Levels[0].Columns)
			{
				if(gc.Visible)
				{
					//Allows for mock resource manager calls in heading text
					//eg HeadingText="ResourceManager.CP_Photos_GridCol_Name"
					if(gc.HeadingText.StartsWith("FileGalleryResourceManager."))
						gc.HeadingText = FileGalleryResourceManager.GetString(gc.HeadingText.Replace("FileGalleryResourceManager.",""));
			
				}
			}
		}
	}
}
